package com.nbufe.strategy.demo2;

/**
 * @Author Zan
 * @Create 2024/5/20 8:53
 * @ClassName: Client
 * @Description : TODO 请用一句话描述该类的功能
 */
public class Client {
    public static void main(String[] args) {
        // 第一天出发
        TrainStrategy travelStrategy = new TrainStrategy();
        travelStrategy.setNumber(18);
        TouristParty touristParty = new TouristParty(travelStrategy);
        touristParty.travelFee();

        // 第二天
        BusStrategy busStrategy = new BusStrategy();
        touristParty = new TouristParty(busStrategy);
        touristParty.travelFee(1, 24); // 一辆车，24小时全天

        // 第三天
        BusStrategy busStrategy1 = new BusStrategy();
        touristParty = new TouristParty(busStrategy1);
        touristParty.travelFee(1, 2);

        FerryStrategy ferryStrategy = new FerryStrategy();
        ferryStrategy.setNumber(18);
        touristParty = new TouristParty(ferryStrategy);
        // 来
        touristParty.travelFee();
        // 回
        touristParty.travelFee();

        // 第四天
        BusStrategy busStrategy2 = new BusStrategy();
        touristParty = new TouristParty(busStrategy2);
        touristParty.travelFee(1, 24);

        // 第五天
        CarStrategy carStrategy = new CarStrategy();
        carStrategy.setNumber(8);
        touristParty = new TouristParty(carStrategy);
        touristParty.travelFee(2, 24);

        // 回去
        AirplaneStrategy airplaneStrategy = new AirplaneStrategy();
        airplaneStrategy.setNumber(18);
        touristParty = new TouristParty(airplaneStrategy);
        touristParty.travelFee();

        System.out.println("总共花费：" + touristParty.getPrice());
    }
}
